Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications
Running procedures and Web objects
The statement that executes a procedure in SpeedScript is the
Note: In SpeedScript, an external procedure file is any legal set of SpeedScript statements in a file. TheRUNstatement. This statement has several forms, depending on the application. The most basic executes a procedure by name. If the named procedure is defined internally to the executing procedure file (or Web object), SpeedScript executes that internal procedure. Otherwise, it looks for an external procedure file to execute.PROCEDUREkeyword is needed only to define internal procedures.You can also pass parameters to procedures that define them using
DEFINEPARAMETERstatements. For complete information on the options available for theRUNstatement, see the OpenEdge Development: Progress 4GL Reference .Persistent procedures
Among the most important forms of the
RUNstatement is theRUNstatement using thePERSISTENToption. When you execute an external procedure, thePERSISTENToption causes the procedure context, including all of its data and internal procedure definitions to remain active in memory after the main-line of the procedure has returned to the caller.This feature allows you to create (instantiate) SpeedScript objects, of which Web objects are the most important in WebSpeed. This is possible because when you
RUNa procedure persistently, you can obtain a handle to the procedure’s active context. This procedure handle allows you to execute any internal procedure defined inside the persistent procedure context. You do this using theINoption of theRUNstatement, where you run an internal procedure in the handle of the persistent procedure. Thus, the persistent procedure maintains state for all of its internal procedure executions.This is also how method and event procedures are implemented in WebSpeed. Generally, you run method procedures in the handle web-utilities-hdl (for the common utility method procedures in
web-util.p) or the handleTHIS-PROCEDURE(which references the current external procedure or Web object).WebSpeed calling conventions
WebSpeed has a special set of procedure calling conventions. The first convention relies on the run-web-object method procedure. This procedure is the standard method to execute a Web object from within another procedure. It is also the basic method
web-disp.puses to execute Web objects in response to Web requests. The run-web-object procedure follows a protocol designed to ensure the integrity of the Web object, whether it is stateless or state aware. This allows WebSpeed to manage Web objects in a consistent manner. The run-web-object method procedure is defined in the utility object,install-path/src/web/objects/web-util.p.The second convention relies on the dispatch method procedure. You use this procedure to execute event procedures, the special class of method procedures that you can override, but whose default code you cannot ordinarily change directly. The dispatch method procedure ensures that the override is executed rather than the default if the override exists. The dispatch method procedure is defined in the include file,
install-path/src/web/method/admweb.i.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |